# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1Property do
  @moduledoc """
  Property of a document.

  ## Attributes

  *   `dateTimeValues` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1DateTimeArray.t`, *default:* `nil`) - Date time property values. It is not supported by CMEK compliant deployment.
  *   `enumValues` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1EnumArray.t`, *default:* `nil`) - Enum property values.
  *   `floatValues` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1FloatArray.t`, *default:* `nil`) - Float property values.
  *   `integerValues` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1IntegerArray.t`, *default:* `nil`) - Integer property values.
  *   `mapProperty` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1MapProperty.t`, *default:* `nil`) - Map property values.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Required. Must match the name of a PropertyDefinition in the DocumentSchema.
  *   `propertyValues` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1PropertyArray.t`, *default:* `nil`) - Nested structured data property values.
  *   `textValues` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1TextArray.t`, *default:* `nil`) - String/text property values.
  *   `timestampValues` (*type:* `GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1TimestampArray.t`, *default:* `nil`) - Timestamp property values. It is not supported by CMEK compliant deployment.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :dateTimeValues =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1DateTimeArray.t()
            | nil,
          :enumValues =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1EnumArray.t() | nil,
          :floatValues =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1FloatArray.t() | nil,
          :integerValues =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1IntegerArray.t()
            | nil,
          :mapProperty =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1MapProperty.t() | nil,
          :name => String.t() | nil,
          :propertyValues =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1PropertyArray.t()
            | nil,
          :textValues =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1TextArray.t() | nil,
          :timestampValues =>
            GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1TimestampArray.t()
            | nil
        }

  field(:dateTimeValues,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1DateTimeArray
  )

  field(:enumValues,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1EnumArray
  )

  field(:floatValues,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1FloatArray
  )

  field(:integerValues,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1IntegerArray
  )

  field(:mapProperty,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1MapProperty
  )

  field(:name)

  field(:propertyValues,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1PropertyArray
  )

  field(:textValues,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1TextArray
  )

  field(:timestampValues,
    as: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1TimestampArray
  )
end

defimpl Poison.Decoder,
  for: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1Property do
  def decode(value, options) do
    GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1Property.decode(
      value,
      options
    )
  end
end

defimpl Poison.Encoder,
  for: GoogleApi.ContentWarehouse.V1.Model.GoogleCloudContentwarehouseV1Property do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
